package com.morningstar.system.handler;

import com.alibaba.fastjson2.JSON;
import com.morningstar.system.dao.entity.SysLogOperate;
import com.morningstar.system.service.SysLogOperateService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 操作日志消息处理类
 *
 * @author Admin
 */
@Slf4j
@Service
public class LoggerOperateHandler {

    @Resource
    private SysLogOperateService logOperateService;

    public void handler(String message) {
        log.info("LoggerOperateHandler:{}", message);
        SysLogOperate operate = JSON.parseObject(message, SysLogOperate.class);
        logOperateService.save(operate);
    }
}
